import request from '@/utils/request'
export default{
  //文章列表
  getArticleListPage(current,limit,articleQuery){
    return request({
      // url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
      url: `/eduservice/article/pageArticleCondition/${current}/${limit}`,
      method: 'post',
      //teacherQuery条件对象，后端使用requestBody获取数据
      data:articleQuery
    })
  },
  //获取所有的文章分类
  getArticleCategoryList(){
    return request({
      url: `/eduservice/article/queryAllArticleCategory`,
      method: 'get',
    })
  },
  getArticleCategoryListPage(current,limit){
    return request({
      url: `/eduservice/article/pageArticleCategory/${current}/${limit}`,
      method: 'get',
    })
  },
  //根据文章类型Id获取信息
  getCategoryById(id){
    return request({
      url: `/eduservice/article/getCategoryById/${id}`,
      method: 'get',
    })
  },
  //添加文章类型
  addArticleCategory(articleCategory){
    return request({
      url: `/eduservice/article/addArticleCategory`,
      method: 'post',
      data:articleCategory
    })
  },
  //修改文章类型
  updateArticleCategory(articleCategory){
    return request({
      url: `/eduservice/article/updateArticleCategory`,
      method: 'post',
      data:articleCategory
    })
  },
  //根据id删除文章类型
  delArticleCategory(id){
    return request({
      url: `/eduservice/article/delArticleCategory/${id}`,
      method: 'get',
    })
  },
  //文章图片上传
  uploadOssFile(file){
    return request({
      url: `/eduoss/fileoss`,
      method: 'post',
      data:file
    })
  },
  //添加文章信息
  addArticle(article){
    return request({
      url: `/eduservice/article/addArticle`,
      method: 'post',
      data:article
    })
  },
  //根据文章Id查看文章信息
  getArticleById(id){
    return request({
      url: `/eduservice/article/getArticleById/${id}`,
      method: 'get',
    })
  },
  //根据文章Id修改文章信息
  updateArticleById(article){
    return request({
      url: `/eduservice/article/updateArticleById`,
      method: 'post',
      data:article
    })
  },
  //根据文章Id删除文章信息
  delArticleById(id){
    return request({
      url: `/eduservice/article/delArticleById/${id}`,
      method: 'get',
    })
  },
}
